/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.jaiz.twitter.util;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Marin*
 */
public class Query {

    private static final Properties properties;

    /*Se carga el properties con un contexto estatico al cargarse la clase*/
    static {
        properties = new Properties();
        try {
            System.out.println("RUTA = "+Query.class.getClassLoader());
            System.out.println("RUTA 2 = "+Thread.currentThread().getContextClassLoader());
            properties.load(Query.class.getClassLoader().getResourceAsStream("../../properties/query.properties"));
        } catch (IOException ex) {
            Logger.getLogger(Query.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /* @Description
     * Metodo Estatico para leer un query de properties*/
    public static String getQuery(String name) {
        return properties.getProperty(name);
    }
}
